package com.desire.config;

import com.desire.service.OrderService;
import com.desire.service.impl.OrderServiceLinuxImpl;
import com.desire.service.impl.OrderServiceWinImpl;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Conditional;
import org.springframework.context.annotation.Configuration;

/**
 * @author LittleDesire
 * @description
 * @date 2022-04-27 周三 19:26
 * @since 17
 */
@Configuration
public class OsConfig {
    /**
     * @return 如果是window系统则会返回window实现类
     */
    @Bean
    @Conditional({WindowCondition.class})
    public OrderService orderServiceWinImp() {
        return new OrderServiceWinImpl();
    }

    @Bean
    @Conditional({LinuxCondition.class})
    public OrderService orderServiceLinuxImp() {
        return new OrderServiceLinuxImpl();
    }
}
